/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-07-17
 * Time: 16:37
 */
public class MyPriorityQueue {
    public void siftUp(int child) {
        int parent = (child - 1) / 2;
        while(parent >= 0) {
            if(elem[parent] < elem[child]) {
                int tmp = elem[parent];
                elem[parent] = elem[child];
                elem[child] = tmp;
                child = parent;
                parent = (parent-1)/2;
            }else {
                break;
            }
        }
    }
}
